//
//  UITableView+EmptyData.m
//  muscleLife
//
//  Created by xalo on 16/5/4.
//  Copyright © 2016年 HeavenAndHell. All rights reserved.
//

#import "UITableView+EmptyData.h"

@implementation UITableView (EmptyData)

-(NSInteger)showMessage:(NSString *)title byDataSourceCount:(NSInteger)count{
    if (count==0) {
        self.backgroundView = ({
            UIImageView *emptyImage=[[UIImageView alloc]initWithFrame:self.frame];
            emptyImage.image=[UIImage imageNamed:@"emptyImage"];
            UILabel *label=[[UILabel alloc]init];
            label.text=title;
            label.textAlignment=NSTextAlignmentCenter;
//            self.separatorStyle=UITableViewCellSeparatorStyleNone;
            [emptyImage addSubview:label];
            emptyImage;
        });
    }else{
        self.backgroundView=nil;
//        self.separatorStyle=UITableViewCellSeparatorStyleSing;
    }
    return count;
}
@end
